<template>
	<view class="weixin-auth">
		<uni-popup :show="true" type="middle">
			<view class="auth">
				<button type="primary" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">授权</button>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	import uniPopup from './uni-popup.vue';
	
	export default {
		components: {
			uniPopup
		},
		data() {
			return {
				
			};
		},
		methods: {
			bindGetUserInfo: function(e) {
				console.log('aaa');
				
				console.log(e);return;
				if(e.detail.userInfo) {
				  var wxInfo = e.detail.userInfo;
				  wx.login({
					success: function(e) {
					  wxInfo.code = e.code;
					  toKen.login(wxInfo,(res) => {
						console.log('auth res');
						wx.navigateBack({});
					  });
					}
				  });
				}
		    }
		}
	}
</script>

<style>

</style>
